{{indexmenu_n>17}}

===== NMEA2000 GNSS=====

See this discussion: [[https://github.com/canboat/canboat/issues/153]]

GNSS Position Data - Message Type NMEA2000 Can  https://hemispheregnss.com/gnssreference/GNSSPositionData.htm
GNSSPositionData Message
Integrity Checking
  * 0x0 No integrity checking
  * 0x1 Safe
  * 0x2 Caution
  * 0X3 Unsafe

  * Note: In N2K, when a 2-bit field has a value of 0x3 it means that it does not contain data.  
  * "Unsafe" is an information. It would be a data.

[[https://www.maretron.com/support/manuals/GPS200UM_1.3.html|Maretron GPS200 GPS Antenna/Receiver v1.3]]
Integrity field on NMEA 2000 PGN 129029 – GNSS Position Data:
  * 9: Integrity – This field always contains a value of 0 (no integrity checking).

Data field (from 0, byte 30, bits 0 and 1) in PGN 129029 sent from a Raymarine A-series multifunction screen.

The captures were made with a logical analyzer. This information has also been verified in the files of the CanBoat project: candumpSample1.txt and candumpSample2.txt

I apologize, I had an error in the byte count. 
"GNSS integrity" starts at message bit 256, this is byte 32.

Looking in different sources I have observed the coincidence with the documentation of Maretron, and of course, it says the same in pgn.h
It seems that this field does not have a useful translation to the sentences: GLL, RMA, RMC and the derivatives for the calculations in navigation: APB, RMB, XTE.

My concern has been to find an equivalence for the field "Data Valid" of these 6 sentences that I mentioned, which is the only one existing for versions of NMEA0183 prior to specification 3.0, and I thought it logical to think that a 0 in the GNSS integrity field corresponded to that "Data Valid" because I detected it together with "Position Fix" in GNS Method. But it is also possible that GNSS integrity is always at 0.
GNS sentence on NMEA0183 has the same "GNSSMethod" information as PGN 129029, so there's no problem.

I think that the best way to interpret "Data Valid" and avoid problems is to ignore GNSS integrity, and use the own indications of NMEA0183:
  * A = Data valid, 
  * V = Loran-C Blink or SNR warning
  * V = General warning flag for other navigation systems when a reliable fix is ​​not available
And:
  * The positioning system Mode Indicator field supplements the positioning system Status fields, 
  * the Status fields shall be set to V = Invalid for all values ​​of Indicator mode 
  * except for A = Autonomous and
  * D = Differential. 
The positioning system Mode Indicator and Status fields shall not be null fields.

So this equivalence seems to be coherent:
129029 (GNSSMethod) Mode Indicator (N0183> = 3.0) Data valid
  * 0x0 No GPS N = Data not Valid V
  * 0x1 GNSS fix A = Autonomous mode A
  * 0x2 DGNSS fix D = Differential mode A
  * 0x3 Precise GNSS D = Differential mode A
  * 0x4 RTK fixed integer D A
  * 0x5 RTK float D A
  * 0x6 Estimated (DR) mode E V
  * 0x7 Manual input M V
  * 0x8 Simulate mode S V
  * 0xE Error N V

I think it is better to use GNSS Method exclusively to have a data integrity information.

The following graphic was helpful to me in using 129029 to create GGA.

{{:opencpn:software:nmea2k-pgn129029-nmea0183-gga.png?direct&600|pgn129029}}


==== PGN 65340, 65379 documentation ====


I have found information about these PGNs. It's not the complete, but I think it's enough.
A later PR https://github.com/canboat/canboat/pull/154/files/af85293cdb5974c5f942a6bbd79c87e07a230d5d..348b94788ac8821d7f5bd3e1cc4c3fa86bb70316

#define LOOKUP_SIMRAD_PILOT_MODE
  (",0=Standby"
  ",1=Auto, compass commanded"
  ",2=Non Follow, hand commanded (not sure)"
  ",3=Wind Mode"  
  ",4=Track Mode"
  ",5=No Drift, COG referenced")

#define LOOKUP_RAYMARINE_PILOT_MODE
  (",0x0000=Standby"
  ",0x0040=Auto, compass commanded"
  ",0x0100=Vane, Wind Mode"
  ",0x0180=Track Mode"
  ",0x0181=No Drift, COG referenced (In track, course changes) ")

=== SECTION: ===
/* proprietary PDU2 (non addressed) single-frame range 0xFF00 to 0xFFFF (65280 - 65535) */

{"Simnet: Autopilot Mode",
 65340,              /* NOTE 65341 in pgn.h maybe is not correct */
 false,
 0x08,
 0,
  {{"Manufacturer Code", 11, RES_MANUFACTURER, false, "=1857", "Simrad"},
  {"Reserved", 2, RES_NOTUSED, false, 0, ""},
  {"Industry Code", 3, RES_LOOKUP, false, "=4", "Marine Industry"},
  {"Autopilot Status 1", BYTES(1), false, "=0x10", "Pilot ON"},
  {"Autopilot Mode", BYTES(1), false, LOOKUP_SIMRAD_PILOT_MODE, ""},
  {0xfe},	  
  {"Autopilot Status 2", 3, false, "=2", "Pilot ON"},
  {"Reserved", 5, RES_NOTUSED, false, 0, "0x1F"},
  {"Reserved", BYTES(2), RES_BINARY, false, 0, "0x00, 0x80"}}}
  
  // Capture StandBy: 0x0CFF3C00, 0x41 0x9F 0x00 0x00 0xFE 0xF8 0x00 0x80
  // Capture Auto: 0x0CFF3C00, 0x41 0x9F 0x10 0x01 0xFE 0xFA 0x00 0x80

  ,
  {"Seatalk: Pilot Mode",
  65379,
  false,
  0x08,
  0,
  {{"Manufacturer Code", 11, RES_MANUFACTURER, false, "=1851", "Raymarine"},
  {"Reserved", 2, RES_NOTUSED, false, 0, ""},
  {"Industry Code", 3, RES_LOOKUP, false, "=4", "Marine Industry"},
  {"Pilot Mode", BYTES(2), LOOKUP_RAYMARINE_PILOT_MODE, false, 0, ""},
  {"Pilot Mode Data", BYTES(1), RES_BINARY, false, 0, ""},
  {"Reserved", BYTES(3), RES_BINARY, false, 0, ""}}}
  
  
  // Capture StandBy: 0x1CFF63CC, 0x3B 0x9F 0x00 0x00 0x00 0x00 0x02 0xFF
  // Capture Auto: 0x1CFF63CC, 0x3B 0x9F 0x40 0x00 0x00 0x00 0x02 0xFF
  // Capture Vane: 0x1CFF63CC, 0x3B 0x9F 0x00 0x01 0x00 0x00 0x02 0xFF
  // Capture Track: 0x1CFF63CC, 0x3B 0x9F 0x80 0x01 0x00 0x00 0x02 0xFF
  // Capture No Drift: 0x1CFF63CC, 0x3B 0x9F 0x81 0x01 0x00 0x00 0x02 0xFF (While track mode, manual course correction)
  
  
==== PGN 65340, 65379 documentation #154 ====

From Tehani:  https://github.com/canboat/canboat/pull/154

==== Canboat NMEA 2000 Decoder ====
https://github.com/canboat/canboat
====Garmin GPSMAP 8400/8600/8700 Series PGN ====
https://www8.garmin.com/manuals/webhelp/gpsmap8400-8600/EN-US/GUID-0C4B3FAB-3E41-438C-B31E-9B5489790913.html
==== Open Skipper ====
http://openskipper.org/
==== Timo's Library for Arduino====
Timo Lappalainen  NMEA 2000 Library for Arduino  https://github.com/ttlappalainen

==== PGN 129038 - Advice to range check Rate of Turn ====
https://github.com/canboat/canboat/issues/162
Rate of turn in an ais "Class A Position Report" is an 8 bit signed integer with special meaning of the values +- 127. As canboat does not detect these special values, an advise is to range check that the magnitude of rate of turn from PGN 129038 is below say 0,208 rad/s.

Kees wrote: 
  * Ha, this is such a beautiful example of how not just me, or open source people, but entire companies get their stuff wrong.
  * You're right, Rate of Turn in the over-the-air messages is a 8 bit signed integer indicating deg/s, but in NMEA2000 it is a 16 bit integer expressed in rad/s.
  * It is on the AIS-to-NMEA2000 device to translate -127 (0x80) to 0xffff (the special value in N2K to indicate a 16 bit value is "missing".)
  * Since chartplotters don't do this either, I don't think CANboat should hide these values.
  * Side note: for years my Navico AIS 300 did this wrong as well. All sorts of boats without heading (which is a special class of vessel, uncommon on the seas but common on Dutch inland waters) would be shown on my chartplotter as all having the same heading. When I reported this to Navico they sent me a free NAIS-400 to test to see if it was fixed!
